<?php
class ModelMessageAuxiliaryPolice extends Model {
	public function getAllAuxiliaryPolice($community_id) {
		$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "config_auxiliary_police mna WHERE mna.community_id = '" . (int)$community_id . "' ");
	
		return $query->rows;
	}
	
	public function getAuxiliaryPolice($auxiliary_police_id){
		$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "config_auxiliary_police mna WHERE mna.auxiliary_police_id = '" . (int)$auxiliary_police_id . "' ");
	
		return $query->row;
	}
	
	public function getAuxiliaryPolices(){
		$query = $this->db->query("SELECT   mna.*,cc.title as community_name FROM " . DB_PREFIX . "config_auxiliary_police mna left join ".DB_PREFIX."config_community cc on(cc.community_id=mna.community_id) ");
		return $query->rows;
	}
}
?>